# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-yaspin
pkgver=2.3.0
pkgrel=2
pkgdesc="Yet Another Terminal Spinner"
url="https://github.com/pavdmyt/yaspin"
license=('MIT')
arch=('any')
depends=('python-termcolor')
makedepends=('python-build' 'python-installer' 'python-poetry-core')
checkdepends=('python-pytest')
source=("https://github.com/pavdmyt/yaspin/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('0e18b7eef0a2a0b76d0600763646f82231c0da671c05394af7d4ecaedf9c3b8b9fc7617b6b867e8c6cacdeb888194d72ac9c116c38888f9b88c8232926860ed6')

build() {
  cd yaspin-$pkgver
  python -m build --no-isolation --wheel
}

check() {
  cd yaspin-$pkgver
  python -m pytest
}

package() {
  cd yaspin-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
